home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gekkan Dennou Club 145
/
Gekkan Dennou Club - 2000.6 Vol. 145 (Japan).7z
/
Gekkan Dennou Club - 2000.6 Vol. 145 (Japan) (Track 1).bin
/
games
/
spassion
/
source.lzh
/
SOURCE
/
FuncEnemy
/
LBOSS.C
< prev
next >
Wrap
Text File
|
2000-03-29
|
27KB
|
865 lines
/*
#include <stdio.h>
#include <iocslib.h>
*/
/* ラストボス */
#include <xsp2lib.h>
#include "../SPASSION.H"
#include "../player.h"
#include "../enemy.h"
#include "../eshot.h"
#include "../effect.h"
#include "../priority.h"
#include "../sound.h"
#include "../entry.h"
#include "../SUB.H"
#ifndef NULL
#define NULL ((void *) 0)
#endif
#define P_X (*((short *) (&player[0].lx))) /*lxの上位ワード*/
#define P_Y (*((short *) (&player[0].ly))) /*lyの上位ワード*/
#define PALET_MAIN 0x0D00
static short MoveEnemyLBoss(ENEMY *);
/*static void TiniEnemyLBoss(ENEMY *);*/
static short MoveEnemyLCore(ENEMY *);
static short MoveEnemyLBattery1(ENEMY *);
static short MoveEnemyLBattery2(ENEMY *);
static short MoveEnemyLBattery3(ENEMY *);
static HIT_XY4 hit_center_u_p[9]={-48-PLAYER_HIT_X,-96-PLAYER_HIT_Y, 32+PLAYER_HIT_X, PLAYER_HIT_Y,};
static HIT_XY4 hit_center_d_p[9]={-48-PLAYER_HIT_X, -PLAYER_HIT_Y, 32+PLAYER_HIT_X, 96+PLAYER_HIT_Y,};
static HIT_XY4 hit_up_p[9]= {-40-PLAYER_HIT_X,-112-PLAYER_HIT_Y,24+PLAYER_HIT_X,-96+PLAYER_HIT_Y};
static HIT_XY4 hit_down_p[9]={-40-PLAYER_HIT_X, 96-PLAYER_HIT_Y,24+PLAYER_HIT_X,112+PLAYER_HIT_Y};
static HIT_XY4 hit_right_u_p[9]={40-PLAYER_HIT_X,-16-PLAYER_HIT_Y,56+PLAYER_HIT_X, 0+PLAYER_HIT_Y};
static HIT_XY4 hit_right_d_p[9]={40-PLAYER_HIT_X, 0-PLAYER_HIT_Y,56+PLAYER_HIT_X,16+PLAYER_HIT_Y};
/* コア */
static HIT_XY4 hit_lcore_p[4];
static HIT_XY4 hit_lcore_o[4];
static HIT_XY4 hit_lcore_s[4]={-8,-10,8,10, -9,-11,9,11, -10,-12,10,12, -11,-13,11,13};
static HIT_XY4 hit_battery_p;
static HIT_XY4 hit_battery_o;
static HIT_XY4 hit_battery_s={-7,-7,7,7};
extern HIT_XY4 nohit;
static ENEMY dummy;
static unsigned char seed=0;
void InitEnemyLBossHit(ENEMY *ene)
{
short i;
for(i=1;i<9;i++){
hit_center_u_p[i].x1=hit_center_u_p[0].x1 ;hit_center_u_p[i].x2=hit_center_u_p[0].x2 ;
hit_center_u_p[i].y1=hit_center_u_p[0].y1-i*4;hit_center_u_p[i].y2=hit_center_u_p[0].y2-i*4;
hit_center_d_p[i].x1=hit_center_d_p[0].x1 ;hit_center_d_p[i].x2=hit_center_d_p[0].x2 ;
hit_center_d_p[i].y1=hit_center_d_p[0].y1+i*4;hit_center_d_p[i].y2=hit_center_d_p[0].y2+i*4;
hit_up_p[i].x1=hit_up_p[0].x1 ;hit_up_p[i].x2=hit_up_p[0].x2 ;
hit_up_p[i].y1=hit_up_p[0].y1-i*4;hit_up_p[i].y2=hit_up_p[0].y2-i*4;
hit_down_p[i].x1=hit_down_p[0].x1 ;hit_down_p[i].x2=hit_down_p[0].x2 ;
hit_down_p[i].y1=hit_down_p[0].y1+i*4;hit_down_p[i].y2=hit_down_p[0].y2+i*4;
hit_right_u_p[i].x1=hit_right_u_p[0].x1 ;hit_right_u_p[i].x2=hit_right_u_p[0].x2 ;
hit_right_u_p[i].y1=hit_right_u_p[0].y1-i*4;hit_right_u_p[i].y2=hit_right_u_p[0].y2-i*4;
hit_right_d_p[i].x1=hit_right_d_p[0].x1 ;hit_right_d_p[i].x2=hit_right_d_p[0].x2 ;
hit_right_d_p[i].y1=hit_right_d_p[0].y1+i*4;hit_right_d_p[i].y2=hit_right_d_p[0].y2+i*4;
}
}
void InitEnemyLCoreHit(ENEMY *ene)
{
short i;
for(i=0;i<4;i++){
hit_lcore_p[i].x1=hit_lcore_s[i].x1-PLAYER_HIT_X;hit_lcore_p[i].x2=hit_lcore_s[i].x2+PLAYER_HIT_X;
hit_lcore_p[i].y1=hit_lcore_s[i].y1-PLAYER_HIT_Y;hit_lcore_p[i].y2=hit_lcore_s[i].y2+PLAYER_HIT_Y;
hit_lcore_o[i].x1=hit_lcore_s[i].x1-OPTION_HIT_X;hit_lcore_o[i].x2=hit_lcore_s[i].x2+OPTION_HIT_X;
hit_lcore_o[i].y1=hit_lcore_s[i].y1-OPTION_HIT_Y;hit_lcore_o[i].y2=hit_lcore_s[i].y2+OPTION_HIT_Y;
}
}
void InitEnemyLBattery1Hit(ENEMY *ene)
{
hit_battery_p.x1=hit_battery_s.x1-PLAYER_HIT_X;hit_battery_p.x2=hit_battery_s.x2+PLAYER_HIT_X;
hit_battery_p.y1=hit_battery_s.y1-PLAYER_HIT_Y;hit_battery_p.y2=hit_battery_s.y2+PLAYER_HIT_Y;
hit_battery_o.x1=hit_battery_s.x1-OPTION_HIT_X;hit_battery_o.x2=hit_battery_s.x2+OPTION_HIT_X;
hit_battery_o.y1=hit_battery_s.y1-OPTION_HIT_Y;hit_battery_o.y2=hit_battery_s.y2+OPTION_HIT_Y;
}
void InitEnemyLBattery2Hit(ENEMY *ene)
{
}
void InitEnemyLBattery3Hit(ENEMY *ene)
{
}
void InitEnemyLBoss(ENEMY *ene)
{
ene->x =ene->lx>>16;
ene->y =ene->ly>>16;
ene->vx = 0;
ene->vy = 65536;
ene->hit_p[0] = &hit_center_u_p[0]; ene->hit_p[1] = &hit_center_d_p[0];
ene->hit_p[2] = &hit_up_p[0]; ene->hit_p[3] = &hit_down_p[0];
ene->hit_p[4] = &hit_right_u_p[0]; ene->hit_p[5] = &hit_right_d_p[0]; ene->hit_p[6] = NULL;
ene->hit_o[0] = &nohit; ene->hit_o[1] = &nohit;
ene->hit_o[2] = &nohit; ene->hit_o[3] = &nohit;
ene->hit_o[4] = &nohit; ene->hit_o[5] = &nohit; ene->hit_s[6] = NULL;
ene->hit_s[0] = &nohit; ene->hit_s[1] = &nohit;
ene->hit_s[2] = &nohit; ene->hit_s[3] = &nohit;
ene->hit_s[4] = &nohit; ene->hit_s[5] = &nohit; ene->hit_s[6] = NULL;
ene->pt = obj_lboss;
ene->info = PALET_MAIN | PRIORITY_BOSS;
ene->no_dead = 0;
ene->func_enemy_move = MoveEnemyLBoss;
/* ene->func_enemy_tini = TiniEnemyLBoss;*/
ene->parts3=MakeEnemy(ENEMY_LCORE , ene->x-8, ene->y ,0, ene); /* コア */
#if 1
MakeEnemy(ENEMY_LBATTERY1 , ene->x+20, ene->y-24 ,0, ene); /* 砲台 */
MakeEnemy(ENEMY_LBATTERY2 , ene->x+18, ene->y-40 ,0, ene);
MakeEnemy(ENEMY_LBATTERY2 , ene->x+16, ene->y-56 ,0, ene);
MakeEnemy(ENEMY_LBATTERY3 , ene->x+14, ene->y-72 ,0, ene);
MakeEnemy(ENEMY_LBATTERY1 , ene->x-20, ene->y-24 ,1, ene); /* 砲台 */
MakeEnemy(ENEMY_LBATTERY2 , ene->x-18, ene->y-40 ,1, ene);
MakeEnemy(ENEMY_LBATTERY2 , ene->x-16, ene->y-56 ,1, ene);
MakeEnemy(ENEMY_LBATTERY3 , ene->x-14, ene->y-72 ,1, ene);
MakeEnemy(ENEMY_LBATTERY1 , ene->x+20, ene->y+24 ,2, ene); /* 砲台 */
MakeEnemy(ENEMY_LBATTERY2 , ene->x+18, ene->y+40 ,2, ene);
MakeEnemy(ENEMY_LBATTERY2 , ene->x+16, ene->y+56 ,2, ene);
MakeEnemy(ENEMY_LBATTERY3 , ene->x+14, ene->y+72 ,2, ene);
MakeEnemy(ENEMY_LBATTERY1 , ene->x-20, ene->y+24 ,3, ene); /* 砲台 */
MakeEnemy(ENEMY_LBATTERY2 , ene->x-18, ene->y+40 ,3, ene);
MakeEnemy(ENEMY_LBATTERY2 , ene->x-16, ene->y+56 ,3, ene);
MakeEnemy(ENEMY_LBATTERY3 , ene->x-14, ene->y+72 ,3, ene);
#endif
ene->work=0;
ene->work2=0;
ene->work3=0;
ene->child = &dummy; /* 仮のパーツ */
entry_counter_stop = !0; /* エントリーカウンター停止 */
}
void InitEnemyLCore(ENEMY *ene)
{
ene->pt = obj_lboss+1;
ene->info = PALET_MAIN | PRIORITY_BOSS_PARTS;
ene->hit_p[1] = NULL;
ene->hit_o[1] = NULL;
ene->hit_s[1] = NULL;
ene->hp = 1000;
ene->no_dead = 0;
ene->func_enemy_move = MoveEnemyLCore;
/* ene->func_enemy_tini = TiniEnemyLBoss;*/
ene->parts1 = ene->parts2 = &dummy; /* 腕が出てくるまでの仮のパーツ */
dummy.child_death =1;
}
void InitEnemyLBattery1(ENEMY *ene)
{
ene->pt = obj_obj+0x22;
ene->info = PALET_MAIN | PRIORITY_BOSS_PARTS;
ene->hit_p[0] = &hit_battery_p;ene->hit_p[1] = NULL;
ene->hit_o[0] = &hit_battery_o;ene->hit_o[1] = NULL;
ene->hit_s[0] = &hit_battery_s;ene->hit_s[1] = NULL;
ene->hp = 100;
ene->no_dead = 0;
ene->move_ax = ene->lx-ene->parent->lx;
ene->move_ay = ene->ly-ene->parent->ly;
ene->func_enemy_move = MoveEnemyLBattery1;
/* ene->func_enemy_tini = TiniEnemyLBoss;*/
}
void InitEnemyLBattery2(ENEMY *ene)
{
ene->pt = obj_obj+0x28;
ene->info = PALET_MAIN | PRIORITY_BOSS_PARTS;
ene->hit_p[0] = &hit_battery_p;ene->hit_p[1] = NULL;
ene->hit_o[0] = &hit_battery_o;ene->hit_o[1] = NULL;
ene->hit_s[0] = &hit_battery_s;ene->hit_s[1] = NULL;
ene->hp = 100;
ene->no_dead = 0;
ene->move_ax = ene->lx-ene->parent->lx;
ene->move_ay = ene->ly-ene->parent->ly;
ene->func_enemy_move = MoveEnemyLBattery2;
/* ene->func_enemy_tini = TiniEnemyLBoss;*/
}
void InitEnemyLBattery3(ENEMY *ene)
{
ene->pt = obj_obj+0x30;
ene->info = PALET_MAIN | PRIORITY_BOSS_PARTS;
ene->hit_p[0] = &hit_battery_p;ene->hit_p[1] = NULL;
ene->hit_o[0] = &hit_battery_o;ene->hit_o[1] = NULL;
ene->hit_s[0] = &hit_battery_s;ene->hit_s[1] = NULL;
ene->hp = 100;
ene->no_dead = 0;
ene->move_ax = ene->lx-ene->parent->lx;
ene->move_ay = ene->ly-ene->parent->ly;
ene->func_enemy_move = MoveEnemyLBattery3;
/* ene->func_enemy_tini = TiniEnemyLBoss;*/
}
static short MoveEnemyLBoss( ENEMY *ene )
{
short anim_num,flg;
/* ESHOT *eshot;*/
short Wait( ENEMY *ene, short time );
/* 爆発 */
if( ene->dead_count ){
ene->dead_count++;
if( ene->y > 256+128+48+16 ){
entry_counter_stop = 0; /* エントリーカウンター停止解除 */
return (0); /* 消去 */
}else if( ene->y > 256+128+16 ){
ene->y = (ene->ly += 65536/2) >> 16;
return (1);
}else{
if( !(ene->dead_count%20) ){
short exp_x,exp_y,x,y;
exp_x=rndtable[seed++]&127;seed&=255;
exp_y=rndtable[seed++]; seed&=255;
MakeEffect(EFFECT_EXPL, 0, (x=ene->x-64+exp_x), (y=ene->y-128+exp_y));
MakeEffect(EFFECT_HAHENMINI, 0, x, y);
SetSE(SE_EXPL_BOSS); /* 爆発音 */
if( !(ene->dead_count%60) ){
MakeEffect(EFFECT_EXPLL, 0, ene->x, ene->y);
MakeEffect (EFFECT_HAHEN, 0, ene->x, ene->y);
SetSE(SE_EXPL_LBOSS); /* 爆発音 */
}
}
ene->y = (ene->ly += 65536/2) >> 16;
if( ene->pt > obj_lboss ){
if( ++ene->anim_count>8 ){
ene->anim_count=0;
ene->pt--;
}
}
xobj_set_st(ene);
return (1);
}
}
/* 速度を足して上位ワード(固定整数部)だけ取り出す */
ene->x = (ene->lx += ene->vx) >> 16;
ene->y = (ene->ly += ene->vy) >> 16;
ene->parts3->x=((ene->parts3->lx=ene->lx )>>16);
ene->parts3->y=((ene->parts3->ly=ene->ly )>>16);
flg=ene->flg;
if( !ene->parts3->child_death ){
/* 腕が片方でも生きてればゆっくり動く */
if( !ene->parts3->parts1->child_death || !ene->parts3->parts2->child_death )
flg=0;
}
switch (ene->state){
case 0:
switch (ene->work){
case 0: /* 画面右、上から下へ */
if( ENE_Y > 0+16 ){
ene->vy = 65536/2+(65536/2)*flg; /* スピードを落とす */
if( ENE_Y > 256+16 ){
ene->vy = 65536+65536*flg; /* スピードを上げる */
if( ENE_Y > 256+128+64+16 ){
ene->lx = (0+16)<<16;
ene->vy = -65536-65536*flg;
ene->work++;
if( rndtable[seed++]>128||player[0].pow_lev==0 ){
seed&=255;
MakeEnemy(ENEMY_ZAKO04, 256+24, rndtable[seed++]+16, 0, ene);
seed&=255;
}
}
}
}
#if 0
ene->work=2;
ene->lx = (256+16)<<16;
ene->ly = (128+16)<<16;
ene->vx = (-1)<<16;
ene->vy = 0;
#endif
break;
case 1: /* 画面左、下から上へ */
if( ENE_Y < 256+16 ){
ene->vy = -65536/2-(65536/2)*flg; /* スピードを落とす */
if( ENE_Y < 0+16 ){
ene->vy = -65536-65536*flg; /* スピードを上げる */
if( ENE_Y < 0-128-64+16 ){
ene->lx = (256+48+16)<<16;
ene->ly = (128+16)<<16;
ene->vx = -65536-65536*flg;
ene->vy = 0;
ene->work++;
}
}
}
break;
case 2: /* 画面右から中央へ */
if( ENE_X < 256-48+16 ){
/* if( ENE_X < 128+16 ){*/
ene->vx = 0;
ene->work++;
}
break;
case 3: /* 分離 */
anim_num=(++ene->anim_count)/8;
ene->pt = obj_lboss+anim_num;
ene->hit_p[0] = &hit_center_u_p[anim_num];
ene->hit_p[1] = &hit_center_d_p[anim_num];
ene->hit_p[2] = &hit_up_p[anim_num];
ene->hit_p[3] = &hit_down_p[anim_num];
ene->hit_p[4] = &hit_right_u_p[anim_num];
ene->hit_p[5] = &hit_right_d_p[anim_num];
if( anim_num == 8 ){
ene->work++;
ene->vx = -65536/2-(65536/2)*flg;
#if 0
ene->work++;
ene->vx = 0;
#endif
}
break;
case 4:
if( ENE_X < 0+48+16 ){
ene->vx = 0;
ene->work++;
}
break;
case 5: /* 合体 */
anim_num=(--ene->anim_count)/8;
ene->pt = obj_lboss+anim_num;
ene->hit_p[0] = &hit_center_u_p[anim_num];
ene->hit_p[1] = &hit_center_d_p[anim_num];
ene->hit_p[2] = &hit_up_p[anim_num];
ene->hit_p[3] = &hit_down_p[anim_num];
ene->hit_p[4] = &hit_right_u_p[anim_num];
ene->hit_p[5] = &hit_right_d_p[anim_num];
if( anim_num == 0 ){
MakeEffect(EFFECT_TITSPARK, 0, ene->x, ene->y);
MakeEffect(EFFECT_TITSPARK, 1, ene->x, ene->y);
SetSE(SE_TRANSFORM); /* 衝撃音 */
ene->work++;
ene->vx = -65536-65536*flg;
}
break;
case 6:
/* 腕の分も移動、腕が伸びきるまで待つ */
/* if( (ENE_X < 0-5*32+16 && (ene->parts3->parts1->child_death && ene->parts3->parts2->child_death))
|| (!ene->parts3->parts1->child_death && ene->parts3->parts1->state>=2 )
|| (!ene->parts3->parts2->child_death && ene->parts3->parts2->state>=2 )){
*/
if( ENE_X < 0-5*32+16 ){
ene->vx = 65536+65536*flg;
ene->work++;
}
break;
case 7: /* 画面左から中央へ */
if( ENE_X > 0+48+16 ){
ene->vx = 0;
ene->work++;
}
break;
case 8: /* 分離 */
anim_num=(++ene->anim_count)/8;
ene->pt = obj_lboss+anim_num;
ene->hit_p[0] = &hit_center_u_p[anim_num];
ene->hit_p[1] = &hit_center_d_p[anim_num];
ene->hit_p[2] = &hit_up_p[anim_num];
ene->hit_p[3] = &hit_down_p[anim_num];
ene->hit_p[4] = &hit_right_u_p[anim_num];
ene->hit_p[5] = &hit_right_d_p[anim_num];
if( anim_num == 8 ){
ene->work++;
ene->vx = 65536/2+(65536/2)*flg;
}
break;
case 9:
if( ENE_X > 256-48+16 ){
ene->vx = 0;
ene->work++;
}
break;
case 10: /* 合体 */
anim_num=(--ene->anim_count)/8;
ene->pt = obj_lboss+anim_num;
ene->hit_p[0] = &hit_center_u_p[anim_num];
ene->hit_p[1] = &hit_center_d_p[anim_num];
ene->hit_p[2] = &hit_up_p[anim_num];
ene->hit_p[3] = &hit_down_p[anim_num];
ene->hit_p[4] = &hit_right_u_p[anim_num];
ene->hit_p[5] = &hit_right_d_p[anim_num];
if( anim_num == 0 ){
MakeEffect(EFFECT_TITSPARK, 0, ene->x, ene->y);
MakeEffect(EFFECT_TITSPARK, 1, ene->x, ene->y);
SetSE(SE_TRANSFORM); /* 衝撃音 */
ene->work++;
ene->vx = 65536+65536*flg;
}
break;
case 11:
/* 腕の分も移動、腕が伸びきるまで待つ */
if( ENE_X > 256+5*32+16 ){
if( (ene->parts3->parts1->child_death && ene->parts3->parts2->child_death)
|| (!ene->parts3->parts1->child_death && ene->parts3->parts1->state>=2 )
|| (!ene->parts3->parts2->child_death && ene->parts3->parts2->state>=2 )){
if( ++ene->flg>2 )ene->flg=2; /* 移動速度を上げる */
ene->child=&dummy;
if( ene->parts3->hp<500 && ene->work2<=3 ){
/* 各面のボスを出す */
switch( ene->work2 ){
case 0:
ene->child=MakeEnemy(ENEMY_BOSS01 , 256+64 , 128+16, 0, ene);
break;
case 1:
ene->child=MakeEnemy(ENEMY_BOSS02 , 256+64 , 128+16, 0, ene);
break;
case 2:
ene->child=MakeEnemy(ENEMY_BOSS03 , 256+64 , 128+16, 0, ene);
break;
case 3:
ene->child=MakeEnemy(ENEMY_BOSS04 , 256+64 , 128+16, 0, ene);
break;
}
ene->work3=1;
/*
if(!ene->child){
printf("NoMake\n");
key_wait();
}
*/
ene->work2++;
ene->parts3->flg=0;
ene->parts3->hp=1000;
}
ene->work++;
}}
break;
case 12: /* さっき出したボスが死んだら、繰り返し */
if( ene->child->child_death ){
ene->child->child_kill=1;
ene->work3=0;
ene->lx = (256+16)<<16;
ene->ly = (-128+16)<<16;
ene->vx = 0;
ene->vy = 65536+65536*flg;
ene->work=0;
#if 0
ene->work=2;
ene->lx = (256+16)<<16;
ene->ly = (128+16)<<16;
ene->vx = (-1)<<16;
ene->vy = 0;
#endif
}
break;
}
break;
}
#if 0
ene->state = 1;
ene->lx = 128*65536;
ene->ly = 128*65536;
ene->vx = 0;
ene->vy = 0;
if( BITSNS(0x04) & BIT(1) ){
while( BITSNS(0x04) & BIT(1) );
entry_counter_stop = 0;
return (0);
}
#endif
/* コアが破壊された */
if( ene->parts3->child_death ){
MakeEffect(EFFECT_EXPLL, 0, ene->x, ene->y);
SetSE(SE_EXPL_LBOSS); /* 爆発音 */
MakeEffect(EFFECT_HAHEN, 0, ene->x, ene->y);
if(!eshot_erase)
eshot_erase = ESHOT_ERASE; /* 弾消し */
ene->player->score += 30;
ene->parts1->child_kill=1;
ene->parts2->child_kill=1;
ene->hit_p[0]=NULL;
ene->dead_count=1;
ene->child_death=1;
}
xobj_set_st(ene);
xobj_set_st(ene->parts3);
return(1);
}
static short MoveEnemyLCore( ENEMY *ene )
{
short anim_num;
if( ene->child_death ){
if( ene->parent->dead_count )
return (0); /* 消去 */
else
return(1);
}
anim_num=(++ene->anim_count)/4;
if( anim_num == 4 ){
ene->anim_count=0;
anim_num=0;
}
ene->pt = obj_lboss+9+anim_num;
ene->hit_p[0]=&hit_lcore_p[anim_num];
ene->hit_o[0]=&hit_lcore_o[anim_num];
ene->hit_s[0]=&hit_lcore_s[anim_num];
if( ene->parts1->child_death )ene->parts1->child_kill=1;
if( ene->parts2->child_death )ene->parts2->child_kill=1;
/* ダメージを受けた時の処理 */
if(ene->damage){
SetSE(SE_CORE_DAMAGE); /* 効果音 */
ene->info = PALET_DAMAGE | PRIORITY_BOSS_PARTS;
ene->hp -= ene->damage;
if( ene->hp <= 0
&& ene->parts1->child_death && ene->parts2->child_death
&& ene->parent->work2>=4
&& (ene->parent->work==4 || ene->parent->work==9) ){
MakeEffect(EFFECT_EXPL, 0, ene->x+8, ene->y+8);
SetSE(SE_EXPL_MBOSS); /* 爆発音 */
if(disp_level == DISP_LEVEL_HIGH)
MakeEffect (EFFECT_HAHEN, 0, ene->x, ene->y);
if(!eshot_erase)
eshot_erase = ESHOT_ERASE; /* 弾消し */
ene->player->score += 20;
ene->child_death = 1;
/* ene->info=0xE00;*/ /* 見えなくする */
ene->parts1->child_kill=1;
ene->parts2->child_kill=1;
ene->hit_p[0]=NULL;
}
ene->damage = 0;
}else
ene->info = PALET_MAIN | PRIORITY_BOSS_PARTS;
if( !ene->flg && ene->hp<500 )ene->hp=500-1;
if( ene->flg==1 && ene->hp< 0 )ene->hp= 0;
if(level>=NOMAL){
if( !ene->flg && ene->hp<500 && ene->parts1->child_death && ene->parts2->child_death
&& ene->parent->work==10 ){
ene->flg++;
ene->parts1=MakeEnemy(ENEMY_BOSSARM, ENE_X, ENE_Y,0x1004, ene);
ene->parts2=MakeEnemy(ENEMY_BOSSARM, ENE_X, ENE_Y,0x1104, ene);
}
}else{
if( !ene->flg && ene->hp<500 )
ene->flg++;
}
/*
B_LOCATE(0,0);
printf("%4d\n",ene->hp);
printf("cd1=%d cd2=%d\n",ene->parts1->child_death,ene->parts2->child_death);
*/
return 1;
}
static short MoveEnemyLBattery1( ENEMY *ene )
{
short anim_num,angle,p_anim_num;
short info[4]={0x0,0x4000,0x8000,0xC000};
int y[4][9]={
0,-4*65536,-8*65536,-12*65536,-16*65536, -20*65536,-24*65536,-28*65536,-32*65536,
0,-4*65536,-8*65536,-12*65536,-16*65536, -20*65536,-24*65536,-28*65536,-32*65536,
0,+4*65536,+8*65536,+12*65536,+16*65536, +20*65536,+24*65536,+28*65536,+32*65536,
0,+4*65536,+8*65536,+12*65536,+16*65536, +20*65536,+24*65536,+28*65536,+32*65536
};
short Wait( ENEMY *ene, short time );
if( ene->child_death ){
if( ene->parent->child_death )
return (0); /* 消去 */
else{
if( ene->parent->work3 ){ /* ラスボス復帰で砲台も復活 */
p_anim_num=ene->parent->pt-obj_lboss;
ene->x = ((ene->lx = ene->parent->lx+ene->move_ax) >> 16)-8; /*-8は表示位置をずらすため*/
ene->y = ((ene->ly = ene->parent->ly+ene->move_ay+y[ene->arg][p_anim_num]) >> 16)-8;
ene->hp=100;
ene->hit_p[0] = &hit_battery_p;
ene->child_death=0;
}
return(1);
}
}
/* 上位ワード(固定整数部)だけ取り出す */
p_anim_num=ene->parent->pt-obj_lboss;
ene->x = ((ene->lx = ene->parent->lx+ene->move_ax) >> 16)-8; /*-8は表示位置をずらすため*/
ene->y = ((ene->ly = ene->parent->ly+ene->move_ay+y[ene->arg][p_anim_num]) >> 16)-8;
switch (ene->work){
case 0: /* 砲身を向ける */
anim_num=(++ene->anim_count)/8;
ene->pt = obj_obj+0x22+anim_num;
if( anim_num == 5 ){
ene->anim_count=6*8;
ene->work++;
}
break;
case 1: /* 砲身を戻す */
anim_num=(--ene->anim_count)/8;
ene->pt = obj_obj+0x22+anim_num;
if( anim_num == 0 ){
ene->anim_count=0;
ene->work++;
/* 画面外では撃たない */
if( ENE_X < 16-8 || ENE_X > 255+24 || ENE_Y < 16-8 || ENE_Y > 255+24 )
ene->work++;
}
break;
case 2: /* 拡散弾 */
MakeEShot(ESHOT_LASER00, ENE_X, ENE_Y, 5, angle=calc_direction( ENE_X, ENE_Y, P_X+CENTER_X, P_Y ), 4,0,ene);
if(level>=NOMAL){
MakeEShot(ESHOT_LASER00, ENE_X, ENE_Y, 5, (angle-16)&255, 4,0,ene);
MakeEShot(ESHOT_LASER00, ENE_X, ENE_Y, 5, (angle+16)&255, 4,0,ene);
}
SetSE(SE_ESHOT_LASER); /* 敵ショット音 */
ene->work++;
break;
case 3: /* 時間稼ぎ */
if( Wait( ene, 30 ) )
ene->work=0;
break;
}
if( ene->parent->child_death ) /* ラスボスが死んだら砲台も死ぬ */
ene->damage=100;
/* ダメージを受けた時の処理 */
if(ene->damage){
SetSE(SE_DAMAGE); /* 効果音 */
ene->info = PALET_DAMAGE | PRIORITY_BOSS_PARTS | info[ene->arg];
if( (ene->hp -= ene->damage) <= 0 ){
MakeEffect(EFFECT_EXPL, 0, ene->x+8, ene->y+8);
SetSE(SE_EXPL_MBOSS); /* 爆発音 */
if(!eshot_erase)
eshot_erase = ESHOT_ERASE; /* 弾消し */
ene->player->score += 5;
ene->child_death = 1;
/* ene->info=0xE00;*/ /* 見えなくする */
ene->hit_p[0]=NULL;
}
ene->damage = 0;
}else
ene->info = PALET_MAIN | PRIORITY_BOSS_PARTS | info[ene->arg];
xsp_set_st(ene);
return 1;
}
static short MoveEnemyLBattery2( ENEMY *ene )
{
short anim_num,angle,p_anim_num;
short info[4]={0x0,0x4000,0x8000,0xC000};
int y[4][9]={
0,-4*65536,-8*65536,-12*65536,-16*65536, -20*65536,-24*65536,-28*65536,-32*65536,
0,-4*65536,-8*65536,-12*65536,-16*65536, -20*65536,-24*65536,-28*65536,-32*65536,
0,+4*65536,+8*65536,+12*65536,+16*65536, +20*65536,+24*65536,+28*65536,+32*65536,
0,+4*65536,+8*65536,+12*65536,+16*65536, +20*65536,+24*65536,+28*65536,+32*65536
};
short Wait( ENEMY *ene, short time );
if( ene->child_death ){
if( ene->parent->child_death )
return (0); /* 消去 */
else{
if( ene->parent->work3 ){ /* ラスボス復帰で砲台も復活 */
p_anim_num=ene->parent->pt-obj_lboss;
ene->x = ((ene->lx = ene->parent->lx+ene->move_ax) >> 16)-8; /*-8は表示位置をずらすため*/
ene->y = ((ene->ly = ene->parent->ly+ene->move_ay+y[ene->arg][p_anim_num]) >> 16)-8;
ene->hp=100;
ene->hit_p[0] = &hit_battery_p;
ene->child_death=0;
}
return(1);
}
}
/* 上位ワード(固定整数部)だけ取り出す */
p_anim_num=ene->parent->pt-obj_lboss;
ene->x = ((ene->lx = ene->parent->lx+ene->move_ax) >> 16)-8; /*-8は表示位置をずらすため*/
ene->y = ((ene->ly = ene->parent->ly+ene->move_ay+y[ene->arg][p_anim_num]) >> 16)-8;
switch (ene->work){
case 0: /* 砲身を向ける */
anim_num=(++ene->anim_count)/8;
ene->pt = obj_obj+0x28+anim_num;
if( anim_num == 7 ){
ene->work++;
/* 画面外では撃たない */
if( ENE_X < 16-8 || ENE_X > 255+24 || ENE_Y < 16-8 || ENE_Y > 255+24 )
ene->work++;
}
break;
case 1: /* 拡散弾 */
MakeEShot(ESHOT_ENERGY03, ENE_X, ENE_Y, 5, angle=calc_direction( ENE_X, ENE_Y, P_X+CENTER_X, P_Y ), 4,0,ene);
if(level>=NOMAL){
MakeEShot(ESHOT_ENERGY03, ENE_X, ENE_Y, 5, (angle-16)&255, 4,0,ene);
MakeEShot(ESHOT_ENERGY03, ENE_X, ENE_Y, 5, (angle+16)&255, 4,0,ene);
}
SetSE(SE_ESHOT_ENRG); /* 敵ショット音 */
ene->work++;
break;
case 2: /* 時間稼ぎ */
if( Wait( ene, 30 ) )
ene->work++;
break;
case 3: /* 砲身を戻す */
anim_num=(--ene->anim_count)/8;
ene->pt = obj_obj+0x28+anim_num;
if( anim_num == 0 ){
ene->anim_count=0;
ene->work++;
}
break;
case 4: /* 時間稼ぎ */
if( Wait( ene, 30 ) )
ene->work=0;
break;
}
if( ene->parent->child_death ) /* ラスボスが死んだら砲台も死ぬ */
ene->damage=100;
/* ダメージを受けた時の処理 */
if(ene->damage){
SetSE(SE_DAMAGE); /* 効果音 */
ene->info = PALET_DAMAGE | PRIORITY_BOSS_PARTS | info[ene->arg];
if( (ene->hp -= ene->damage) <= 0 ){
MakeEffect(EFFECT_EXPL, 0, ene->x+8, ene->y+8);
SetSE(SE_EXPL_MBOSS); /* 爆発音 */
if(!eshot_erase)
eshot_erase = ESHOT_ERASE; /* 弾消し */
ene->player->score += 5;
ene->child_death = 1;
/* ene->info=0xE00;*/ /* 見えなくする */
ene->hit_p[0]=NULL;
}
ene->damage = 0;
}else
ene->info = PALET_MAIN | PRIORITY_BOSS_PARTS | info[ene->arg];
xsp_set_st(ene);
return 1;
}
static short MoveEnemyLBattery3( ENEMY *ene )
{
short anim_num,angle,p_anim_num;
short info[4]={0x0,0x4000,0x8000,0xC000};
int y[4][9]={
0,-4*65536,-8*65536,-12*65536,-16*65536, -20*65536,-24*65536,-28*65536,-32*65536,
0,-4*65536,-8*65536,-12*65536,-16*65536, -20*65536,-24*65536,-28*65536,-32*65536,
0,+4*65536,+8*65536,+12*65536,+16*65536, +20*65536,+24*65536,+28*65536,+32*65536,
0,+4*65536,+8*65536,+12*65536,+16*65536, +20*65536,+24*65536,+28*65536,+32*65536
};
short Wait( ENEMY *ene, short time );
p_anim_num=ene->parent->pt-obj_lboss;
if( ene->child_death ){
if( ene->parent->child_death )
return (0); /* 消去 */
else{
if( ene->parent->work3 ){ /* ラスボス復帰で砲台も復活 */
ene->x = ((ene->lx = ene->parent->lx+ene->move_ax) >> 16)-8; /*-8は表示位置をずらすため*/
ene->y = ((ene->ly = ene->parent->ly+ene->move_ay+y[ene->arg][p_anim_num]) >> 16)-8;
ene->hp=100;
ene->hit_p[0] = &hit_battery_p;
ene->child_death=0;
}
return(1);
}
}
/* 上位ワード(固定整数部)だけ取り出す */
p_anim_num=ene->parent->pt-obj_lboss;
ene->x = ((ene->lx = ene->parent->lx+ene->move_ax) >> 16)-8; /*-8は表示位置をずらすため*/
ene->y = ((ene->ly = ene->parent->ly+ene->move_ay+y[ene->arg][p_anim_num]) >> 16)-8;
switch (ene->work){
case 0: /* 砲身を向ける */
anim_num=(++ene->anim_count)/8;
ene->pt = obj_obj+0x30+anim_num;
if( anim_num == 7 ){
ene->work++;
/* 画面外では撃たない */
if( ENE_X < 16-8 || ENE_X > 255+24 || ENE_Y < 16-8 || ENE_Y > 255+24 )
ene->work++;
}
break;
case 1: /* 自動追尾弾 */
if( Wait( ene, 60 ) ){
if(level>=HARD){
MakeEShot(ESHOT_HOMING, ENE_X, ENE_Y, 5, angle=calc_direction( ENE_X, ENE_Y, P_X+CENTER_X, P_Y ), 4,0,ene);
MakeEShot(ESHOT_HOMING, ENE_X, ENE_Y, 5, (angle-16)&255, 4,0,ene);
MakeEShot(ESHOT_HOMING, ENE_X, ENE_Y, 5, (angle+16)&255, 4,0,ene);
SetSE(SE_ESHOT_HOMING); /* 敵ショット音 */
}
ene->work++;
}
break;
case 2: /* 時間稼ぎ */
if( Wait( ene, 30 ) )
ene->work++;
break;
case 3: /* 砲身を戻す */
anim_num=(--ene->anim_count)/8;
ene->pt = obj_obj+0x30+anim_num;
if( anim_num == 0 ){
ene->anim_count=0;
ene->work++;
}
break;
case 4: /* 時間稼ぎ */
if( Wait( ene, 30 ) )
ene->work=0;
break;
}
if( ene->parent->child_death ) /* ラスボスが死んだら砲台も死ぬ */
ene->damage=100;
/* ダメージを受けた時の処理 */
if(ene->damage){
SetSE(SE_DAMAGE); /* 効果音 */
ene->info = PALET_DAMAGE | PRIORITY_BOSS_PARTS | info[ene->arg];
if( (ene->hp -= ene->damage) <= 0 ){
MakeEffect(EFFECT_EXPL, 0, ene->x+8, ene->y+8);
SetSE(SE_EXPL_MBOSS); /* 爆発音 */
if(!eshot_erase)
eshot_erase = ESHOT_ERASE; /* 弾消し */
ene->player->score += 5;
ene->child_death = 1;
/* ene->info=0xE00;*/ /* 見えなくする */
ene->hit_p[0]=NULL;
}
ene->damage = 0;
}else
ene->info = PALET_MAIN | PRIORITY_BOSS_PARTS | info[ene->arg];
xsp_set_st(ene);
return 1;
}
/*
static void TiniEnemyLBoss(ENEMY * p)
{
}
*/